home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume10 / pccurses14 / part01 next >
Encoding:
Text File  |  1990-01-19  |  50.1 KB  |  1,560 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v10i015: PCcurses v.1.4 part 1 of 7
  3. from: bl@infovox.se (Bj|rn Larsson)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 10, Issue 15
  7. Submitted-by: bl@infovox.se (Bj|rn Larsson)
  8. Archive-name: pccurses14/part01
  9.  
  10. This is version 1.4 of PCcurses (a PC version of the standard UNIX
  11. screen and window library called CURSES). I hope that suffices as a
  12. description of the contents. The file readme.now describes the
  13. development history. The package supports TurboC and MicroSoft C,
  14. but should be easy to port to any other compiler (it was in fact
  15. ported to a 68000 system in about a day - with limitations, of
  16. course).
  17.  
  18. I hope the moderator does not frown too much at the last part, which
  19. contains an uuencoded binary of a MAKE program for DOS. It is inclu-
  20. ded because a decent MAKE is needed to build the package...:-(
  21.  
  22. Disclaimer: There is also another CURSES-lookalike with the same name,
  23. maintained by Jeff Dean (parcvax,hplabs}!cdp!jeff, jeff@ads.arpa).
  24. The PCcurses you are looking at comes from Bjorn Larsson (bl@infovox.se).
  25. Just to avoid confusion.
  26.  
  27.                             Bjorn
  28.  
  29.  
  30. # ----------------------------- cut here -----------------------------
  31. #! /bin/sh
  32. # This is a shell archive. Remove anything before the `cut' line,
  33. # then unpack by saving it into a file and typing `sh file'. The
  34. # archive ends by exit(0), so don't worry about trailing junk.
  35. #       (This is archive 1 in a series of 7).
  36. # Contents:
  37. #   beep.c
  38. #   bllibc.cmd
  39. #   charpick.c
  40. #   curses.cmd
  41. #   curses68.cmd
  42. #   endwin.c
  43. #   farcall.inc
  44. #   hugedata.inc
  45. #   initscr.c
  46. #   longname.c
  47. #   MANIFEST
  48. #   move.c
  49. #   mvcursor.c
  50. #   nearcall.inc
  51. #   scrreg.c
  52. #   smaldata.inc
  53. #   stradd.c
  54. #   tabsize.c
  55. #   termmisc.c
  56. #   unctrl.c
  57. #   winclear.c
  58. #   windel.c
  59. #   winerase.c
  60. #   winmove.c
  61. #   winscrol.c
  62. #   wintouch.c
  63. # Wrapped by USER@MS-DOS --- Sun Jan 14 14:02:16 1990
  64. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  65. if test -f beep.c -a "${1}" != "-c" ; then 
  66.   echo Will not over-write existing file \"beep.c\"
  67. else
  68. echo Extracting - \"beep.c\"
  69. sed "s/^X//" >beep.c <<'END_OF_beep.c'
  70. X/****************************************************************/
  71. X/*                                */
  72. X/* Beep() and flash() routines of the PCcurses package        */
  73. X/*                                */
  74. X/****************************************************************/
  75. X/* This version of curses is based on ncurses, a curses version    */
  76. X/* originally written by Pavel Curtis at Cornell University.    */
  77. X/* I have made substantial changes to make it run on IBM PC's,    */
  78. X/* and therefore consider myself free to make it public domain.    */
  79. X/*                Bjorn Larsson (bl@infovox.se)    */
  80. X/****************************************************************/
  81. X/* 1.4:  Use short wherever possible. Portability        */
  82. X/*     improvements:                    900114    */
  83. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  84. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  85. X/* 1.0:     Release:                    870515    */
  86. X/****************************************************************/
  87. X
  88. X#include <curses.h>
  89. X#include <curspriv.h>
  90. X
  91. Xchar _curses_beep_rcsid[] = "@(#)beep.c       v.1.4  - 900114";
  92. X
  93. X/****************************************************************/
  94. X/* Beep() sounds the terminal bell.                */
  95. X/****************************************************************/
  96. X
  97. Xvoid    beep()
  98. X  {
  99. X  _cursesputc('\007',0);
  100. X  } /* beep */
  101. X
  102. X/****************************************************************/
  103. X/* Flash() flashes the terminal screen.                */
  104. X/****************************************************************/
  105. X
  106. Xvoid    flash()
  107. X  {
  108. X  short i;
  109. X
  110. X  _cursesscroll(0,0,LINES-1,COLS-1,0,0x70);
  111. X  for (i=0;i<10000;)
  112. X    i++;
  113. X  _cursesscroll(0,0,LINES-1,COLS-1,0,0x0);
  114. X  wrefresh(curscr);
  115. X  } /* flash */
  116. END_OF_beep.c
  117. if test 1589 -ne `wc -c <beep.c`; then
  118.     echo \"beep.c\" unpacked with wrong size!
  119. fi
  120. # end of overwriting check
  121. fi
  122. if test -f bllibc.cmd -a "${1}" != "-c" ; then 
  123.   echo Will not over-write existing file \"bllibc.cmd\"
  124. else
  125. echo Extracting - \"bllibc.cmd\"
  126. sed "s/^X//" >bllibc.cmd <<'END_OF_bllibc.cmd'
  127. X
  128. X-attrib.obj   &
  129. X-beep.obj     &
  130. X-border.obj   &
  131. X-boxes.obj    &
  132. X-charadd.obj  &
  133. X-chardel.obj  &
  134. X-charget.obj  &
  135. X-charins.obj  &
  136. X-charpick.obj &
  137. X-clrtobot.obj &
  138. X-clrtoeol.obj &
  139. X-cursesio.obj &
  140. X-endwin.obj   &
  141. X-initscr.obj  &
  142. X-linedel.obj  &
  143. X-lineins.obj  &
  144. X-longname.obj &
  145. X-move.obj     &
  146. X-mvcursor     &
  147. X-newwin.obj   &
  148. X-options.obj  &
  149. X-overlay.obj  &
  150. X-prntscan.obj &
  151. X-refresh.obj  &
  152. X-scrreg.obj   &
  153. X-setmode.obj  &
  154. X-setterm.obj  &
  155. X-stradd.obj   &
  156. X-strget.obj   &
  157. X-tabsize.obj  &
  158. X-termmisc.obj &
  159. X-unctrl.obj   &
  160. X-update.obj   &
  161. X-winclear.obj &
  162. X-windel.obj   &
  163. X-winerase.obj &
  164. X-winmove.obj  &
  165. X-winscrol.obj &
  166. X-wintouch.obj &
  167. X+bltmp.lib
  168. X
  169. X
  170. X
  171. END_OF_bllibc.cmd
  172. if test 639 -ne `wc -c <bllibc.cmd`; then
  173.     echo \"bllibc.cmd\" unpacked with wrong size!
  174. fi
  175. # end of overwriting check
  176. fi
  177. if test -f charpick.c -a "${1}" != "-c" ; then 
  178.   echo Will not over-write existing file \"charpick.c\"
  179. else
  180. echo Extracting - \"charpick.c\"
  181. sed "s/^X//" >charpick.c <<'END_OF_charpick.c'
  182. X/****************************************************************/
  183. X/* Winch() routine of the PCcurses package            */
  184. X/*                                */
  185. X/****************************************************************/
  186. X/* This version of curses is based on ncurses, a curses version    */
  187. X/* originally written by Pavel Curtis at Cornell University.    */
  188. X/* I have made substantial changes to make it run on IBM PC's,    */
  189. X/* and therefore consider myself free to make it public domain.    */
  190. X/*                Bjorn Larsson (bl@infovox.se)    */
  191. X/****************************************************************/
  192. X/* 1.4:  Use of short wherever possible. Portability        */
  193. X/*     improvements:                    900114    */
  194. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  195. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  196. X/* 1.0:     Release:                    870515    */
  197. X/****************************************************************/
  198. X
  199. X#include <curses.h>
  200. X#include <curspriv.h>
  201. X
  202. Xchar _curses_charpick_rcsid[] = "@(#)charpick.c   v.1.4  - 900114";
  203. X
  204. X/****************************************************************/
  205. X/* Winch(win) returns the character at the current position in    */
  206. X/* window 'win'.                        */
  207. X/****************************************************************/
  208. X
  209. Xint    winch(win)
  210. X  WINDOW    *win;
  211. X  {
  212. X  return((win->_line[win->_cury][win->_curx]) & 0xff);
  213. X  } /* winch */
  214. X
  215. X/****************************************************************/
  216. X/* Inch() returns the character at the current cursor position    */
  217. X/* in stdscr.                            */
  218. X/****************************************************************/
  219. X
  220. Xint inch()
  221. X  {
  222. X  return((stdscr->_line[stdscr->_cury][stdscr->_curx]) & 0xff);
  223. X  } /* inch */
  224. X
  225. X/****************************************************************/
  226. X/* Mvinch() moves the stdscr cursor to a new position, then    */
  227. X/* returns the character at that position.            */
  228. X/****************************************************************/
  229. X
  230. Xint mvinch(y,x)
  231. X  int  y;
  232. X  int  x;
  233. X  {
  234. X  if (wmove(stdscr,y,x) == ERR)
  235. X    return(ERR);
  236. X  return((stdscr->_line[stdscr->_cury][stdscr->_curx]) & 0xff);
  237. X  } /* mvinch */
  238. X
  239. X/****************************************************************/
  240. X/* Mvwinch() moves the cursor of window 'win' to a new posi-    */
  241. X/* tion, then returns the character at that position.        */
  242. X/****************************************************************/
  243. X
  244. Xint mvwinch(win,y,x)
  245. X  WINDOW *win;
  246. X  int  y;
  247. X  int  x;
  248. X  {
  249. X  if (wmove(win,y,x) == ERR)
  250. X    return(ERR);
  251. X  return((win->_line[win->_cury][win->_curx]) & 0xff);
  252. X  } /* mvwinch */
  253. END_OF_charpick.c
  254. if test 2479 -ne `wc -c <charpick.c`; then
  255.     echo \"charpick.c\" unpacked with wrong size!
  256. fi
  257. # end of overwriting check
  258. fi
  259. if test -f curses.cmd -a "${1}" != "-c" ; then 
  260.   echo Will not over-write existing file \"curses.cmd\"
  261. else
  262. echo Extracting - \"curses.cmd\"
  263. sed "s/^X//" >curses.cmd <<'END_OF_curses.cmd'
  264. Xtmp.lib
  265. Xy
  266. X+attrib.obj   &
  267. X+beep.obj     &
  268. X+border.obj   &
  269. X+boxes.obj    &
  270. X+charadd.obj  &
  271. X+chardel.obj  &
  272. X+charget.obj  &
  273. X+charins.obj  &
  274. X+charpick.obj &
  275. X+clrtobot.obj &
  276. X+clrtoeol.obj &
  277. X+cursesio.obj &
  278. X+endwin.obj   &
  279. X+initscr.obj  &
  280. X+linedel.obj  &
  281. X+lineins.obj  &
  282. X+longname.obj &
  283. X+move.obj     &
  284. X+mvcursor     &
  285. X+newwin.obj   &
  286. X+options.obj  &
  287. X+overlay.obj  &
  288. X+prntscan.obj &
  289. X+refresh.obj  &
  290. X+scrreg.obj   &
  291. X+setmode.obj  &
  292. X+setterm.obj  &
  293. X+stradd.obj   &
  294. X+strget.obj   &
  295. X+tabsize.obj  &
  296. X+termmisc.obj &
  297. X+unctrl.obj   &
  298. X+update.obj   &
  299. X+winclear.obj &
  300. X+windel.obj   &
  301. X+winerase.obj &
  302. X+winmove.obj  &
  303. X+winscrol.obj &
  304. X+wintouch.obj
  305. Xnul
  306. END_OF_curses.cmd
  307. if test 636 -ne `wc -c <curses.cmd`; then
  308.     echo \"curses.cmd\" unpacked with wrong size!
  309. fi
  310. # end of overwriting check
  311. fi
  312. if test -f curses68.cmd -a "${1}" != "-c" ; then 
  313.   echo Will not over-write existing file \"curses68.cmd\"
  314. else
  315. echo Extracting - \"curses68.cmd\"
  316. sed "s/^X//" >curses68.cmd <<'END_OF_curses68.cmd'
  317. X        ; Create new 68000 Curses library
  318. X        ;
  319. XCREATE  CURSES.LIB
  320. X        ;
  321. XADD    CURSES.LIB = ATTRIB.OBJ
  322. XADD    CURSES.LIB = BEEP.OBJ    
  323. XADD    CURSES.LIB = BORDER.OBJ
  324. XADD    CURSES.LIB = BOXES.OBJ
  325. XADD    CURSES.LIB = CHARADD.OBJ
  326. XADD    CURSES.LIB = CHARDEL.OBJ
  327. XADD    CURSES.LIB = CHARGET.OBJ
  328. XADD    CURSES.LIB = CHARINS.OBJ
  329. XADD    CURSES.LIB = CHARPICK.OBJ
  330. XADD    CURSES.LIB = CLRTOBOT.OBJ
  331. XADD    CURSES.LIB = CLRTOEOL.OBJ
  332. XADD    CURSES.LIB = ENDWIN.OBJ
  333. XADD    CURSES.LIB = INITSCR.OBJ
  334. XADD    CURSES.LIB = LINEDEL.OBJ
  335. XADD    CURSES.LIB = LINEINS.OBJ
  336. XADD    CURSES.LIB = LONGNAME.OBJ
  337. XADD    CURSES.LIB = MOVE.OBJ
  338. XADD    CURSES.LIB = MVCURSOR.OBJ
  339. XADD    CURSES.LIB = NEWWIN.OBJ
  340. XADD    CURSES.LIB = OPTIONS.OBJ
  341. XADD    CURSES.LIB = OVERLAY.OBJ
  342. XADD    CURSES.LIB = PRNTSCAN.OBJ
  343. XADD    CURSES.LIB = REFRESH.OBJ
  344. XADD    CURSES.LIB = SCRREG.OBJ
  345. XADD    CURSES.LIB = SETMODE.OBJ
  346. XADD    CURSES.LIB = SETTERM.OBJ
  347. XADD    CURSES.LIB = STRADD.OBJ
  348. XADD    CURSES.LIB = STRGET.OBJ
  349. XADD    CURSES.LIB = TABSIZE.OBJ
  350. XADD    CURSES.LIB = TERMMISC.OBJ
  351. XADD    CURSES.LIB = UNCTRL.OBJ
  352. XADD    CURSES.LIB = UPDATE.OBJ
  353. XADD    CURSES.LIB = WINCLEAR.OBJ
  354. XADD    CURSES.LIB = WINDEL.OBJ
  355. XADD    CURSES.LIB = WINERASE.OBJ
  356. XADD    CURSES.LIB = WINMOVE.OBJ
  357. XADD    CURSES.LIB = WINSCROL.OBJ
  358. XADD    CURSES.LIB = WINTOUCH.OBJ
  359. XADD    CURSES.LIB = CURSES68.OBJ
  360. X    ;
  361. XEXIT
  362. END_OF_curses68.cmd
  363. if test 1215 -ne `wc -c <curses68.cmd`; then
  364.     echo \"curses68.cmd\" unpacked with wrong size!
  365. fi
  366. # end of overwriting check
  367. fi
  368. if test -f endwin.c -a "${1}" != "-c" ; then 
  369.   echo Will not over-write existing file \"endwin.c\"
  370. else
  371. echo Extracting - \"endwin.c\"
  372. sed "s/^X//" >endwin.c <<'END_OF_endwin.c'
  373. X/****************************************************************/
  374. X/* Endwin() routine of the PCcurses package            */
  375. X/*                                */
  376. X/****************************************************************/
  377. X/* This version of curses is based on ncurses, a curses version    */
  378. X/* originally written by Pavel Curtis at Cornell University.    */
  379. X/* I have made substantial changes to make it run on IBM PC's,    */
  380. X/* and therefore consider myself free to make it public domain.    */
  381. X/*                Bjorn Larsson (bl@infovox.se)    */
  382. X/****************************************************************/
  383. X/* 1.4:  Use of short wherever possible Portability        */
  384. X/*     improvements:                    900114    */
  385. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  386. X/* 1.2:     Changed call sequqnce to cursesio.[c,asm], Thanks    */
  387. X/*     to S. Creps. Rcsid[] string for maintenance:    881002    */
  388. X/* 1.0:     Release:                    870515    */
  389. X/****************************************************************/
  390. X
  391. X#include <curses.h>
  392. X#include <curspriv.h>
  393. X
  394. Xchar _curses_endwin_rcsid[] = "@(#)endwin.c     v.1.4  - 900114";
  395. X
  396. X/****************************************************************/
  397. X/* Endwin() does neccessary clean-up after using the PCcurses    */
  398. X/* package. It should be called before exiting the user's pro-    */
  399. X/* gram.                            */
  400. X/****************************************************************/
  401. X
  402. Xint endwin()
  403. X  {
  404. X  delwin(stdscr);
  405. X  delwin(curscr);
  406. X  delwin(_cursvar.tmpwin);
  407. X  curson();                /* turn on cursor if off */
  408. X  _cursescursor(LINES-1, 0);        /* put at lower left */
  409. X  _cursesscb(_cursvar.orgcbr);        /* restore original ^BREAK setting */
  410. X  return(OK);
  411. X  } /* endwin */
  412. END_OF_endwin.c
  413. if test 1604 -ne `wc -c <endwin.c`; then
  414.     echo \"endwin.c\" unpacked with wrong size!
  415. fi
  416. # end of overwriting check
  417. fi
  418. if test -f farcall.inc -a "${1}" != "-c" ; then 
  419.   echo Will not over-write existing file \"farcall.inc\"
  420. else
  421. echo Extracting - \"farcall.inc\"
  422. sed "s/^X//" >farcall.inc <<'END_OF_farcall.inc'
  423. X    far_call EQU    1
  424. END_OF_farcall.inc
  425. if test 16 -ne `wc -c <farcall.inc`; then
  426.     echo \"farcall.inc\" unpacked with wrong size!
  427. fi
  428. # end of overwriting check
  429. fi
  430. if test -f hugedata.inc -a "${1}" != "-c" ; then 
  431.   echo Will not over-write existing file \"hugedata.inc\"
  432. else
  433. echo Extracting - \"hugedata.inc\"
  434. sed "s/^X//" >hugedata.inc <<'END_OF_hugedata.inc'
  435. X    huge_data EQU    1
  436. END_OF_hugedata.inc
  437. if test 17 -ne `wc -c <hugedata.inc`; then
  438.     echo \"hugedata.inc\" unpacked with wrong size!
  439. fi
  440. # end of overwriting check
  441. fi
  442. if test -f initscr.c -a "${1}" != "-c" ; then 
  443.   echo Will not over-write existing file \"initscr.c\"
  444. else
  445. echo Extracting - \"initscr.c\"
  446. sed "s/^X//" >initscr.c <<'END_OF_initscr.c'
  447. X/****************************************************************/
  448. X/* Initscr() routine of the PCcurses package            */
  449. X/*                                */
  450. X/****************************************************************/
  451. X/* This version of curses is based on ncurses, a curses version    */
  452. X/* originally written by Pavel Curtis at Cornell University.    */
  453. X/* I have made substantial changes to make it run on IBM PC's,    */
  454. X/* and therefore consider myself free to make it public domain.    */
  455. X/*                Bjorn Larsson (bl@infovox.se)    */
  456. X/****************************************************************/
  457. X/* 1.4:  Use of short wherever possible. Portability        */
  458. X/*     improvements:                    900114    */
  459. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  460. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  461. X/* 1.1:     Revision string in the code:            880306    */
  462. X/* 1.0:     Release:                    870515    */
  463. X/****************************************************************/
  464. X
  465. X#include <curses.h>
  466. X#include <curspriv.h>
  467. X
  468. Xchar _curses_initscr_rcsid[] = "@(#)initscr.c    v.1.4  - 900114";
  469. Xchar _curses_revcod[] =  CURSES_RCS_ID;
  470. Xchar _curses_cpyrgt[] = "Author B. Larsson - Public Domain";
  471. X
  472. Xextern    void    exit();        /* to avoid warings */
  473. X
  474. XWINDOW *curscr;            /* the current screen image */
  475. XWINDOW *stdscr;            /* the default screen window */
  476. Xcursv   _cursvar;        /* curses variables */
  477. Xint    LINES;            /* terminal height */
  478. Xint    COLS;            /* terminal width */
  479. X
  480. X/****************************************************************/
  481. X/* Initscr() does neccessary initializations for the PCcurses    */
  482. X/* package. It MUST be called before any other curses routines.    */
  483. X/****************************************************************/
  484. X
  485. Xint initscr()
  486. X  {
  487. X  _cursvar.cursrow   = -1;        /* Initial cursor unknown */
  488. X  _cursvar.curscol   = -1;
  489. X  _cursvar.autocr    = TRUE;        /* lf -> crlf by default */
  490. X  _cursvar.raw       = FALSE;        /* tty I/O modes */
  491. X  _cursvar.cbreak    = FALSE;
  492. X  _cursvar.echo      = TRUE;
  493. X  _cursvar.refrbrk   = FALSE;        /* no premature end of refresh */
  494. X  _cursvar.orgcbr    = (bool)_cursesgcb();/* original ^BREAK setting */
  495. X
  496. X  LINES              = 25;        /* this ought to be fixed */
  497. X  COLS               = _cursesgcols();
  498. X
  499. X  if ((_cursvar.tmpwin = newwin(LINES,COLS,0,0)) == (WINDOW *)ERR)
  500. X    exit(1);
  501. X  if ((curscr = newwin(LINES,COLS,0,0)) == (WINDOW *)ERR)
  502. X    exit(1);
  503. X  if ((stdscr = newwin(LINES,COLS,0,0)) == (WINDOW *)ERR)
  504. X    exit(1);
  505. X  curscr->_clear = FALSE;
  506. X  return(OK);
  507. X  } /* initscr */
  508. END_OF_initscr.c
  509. if test 2434 -ne `wc -c <initscr.c`; then
  510.     echo \"initscr.c\" unpacked with wrong size!
  511. fi
  512. # end of overwriting check
  513. fi
  514. if test -f longname.c -a "${1}" != "-c" ; then 
  515.   echo Will not over-write existing file \"longname.c\"
  516. else
  517. echo Extracting - \"longname.c\"
  518. sed "s/^X//" >longname.c <<'END_OF_longname.c'
  519. X/****************************************************************/
  520. X/* Longname() routine of the PCcurses package            */
  521. X/*                                */
  522. X/****************************************************************/
  523. X/* This version of curses is based on ncurses, a curses version    */
  524. X/* originally written by Pavel Curtis at Cornell University.    */
  525. X/* I have made substantial changes to make it run on IBM PC's,    */
  526. X/* and therefore consider myself free to make it public domain.    */
  527. X/*                Bjorn Larsson (bl@infovox.se)    */
  528. X/****************************************************************/
  529. X/* 1.4:  Use of short wherever possible. Portability        */
  530. X/*     improvements:                    900114    */
  531. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  532. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  533. X/* 1.0:     Release:                    870515    */
  534. X/****************************************************************/
  535. X
  536. X#include <curses.h>
  537. X#include <curspriv.h>
  538. X
  539. Xchar _curses_longname_rcsid[] = "@(#)longname.c   v.1.4  - 900114";
  540. X
  541. X/****************************************************************/
  542. X/* Longname() returns a pointer to a string describing the    */
  543. X/* user terminal.                        */
  544. X/****************************************************************/
  545. X
  546. Xchar *longname()
  547. X  {
  548. X  return("IBM_PC_BIOS");
  549. X  }/* longname */
  550. END_OF_longname.c
  551. if test 1265 -ne `wc -c <longname.c`; then
  552.     echo \"longname.c\" unpacked with wrong size!
  553. fi
  554. # end of overwriting check
  555. fi
  556. if test -f MANIFEST -a "${1}" != "-c" ; then 
  557.   echo Will not over-write existing file \"MANIFEST\"
  558. else
  559. echo Extracting - \"MANIFEST\"
  560. sed "s/^X//" >MANIFEST <<'END_OF_MANIFEST'
  561. X    File Name           Archive #       Description
  562. X-----------------------------------------------------------
  563. X attrib.c                  2    
  564. X beep.c                    1    
  565. X bllibc.cmd                1    
  566. X border.c                  2    
  567. X boxes.c                   2    
  568. X charadd.c                 3    
  569. X chardel.c                 2    
  570. X charget.c                 4    
  571. X charins.c                 3    
  572. X charpick.c                1    
  573. X clrtobot.c                2    
  574. X clrtoeol.c                2    
  575. X curses.3                  6    
  576. X curses.cmd                1    
  577. X curses.h                  5    
  578. X curses68.c                3    
  579. X curses68.cmd              1    
  580. X cursesio.asm              4    
  581. X curspriv.h                2    
  582. X endwin.c                  1    
  583. X farcall.inc               1    
  584. X hugedata.inc              1    
  585. X initscr.c                 1    
  586. X linedel.c                 2    
  587. X lineins.c                 2    
  588. X longname.c                1    
  589. X make.man                  3    
  590. X make.uu                   7    
  591. X makefile.68               4    
  592. X makefile.msc              5    
  593. X makefile.trc              5    
  594. X MANIFEST                  1    
  595. X move.c                    1    
  596. X mvcursor.c                1    
  597. X nearcall.inc              1    
  598. X newwin.c                  3    
  599. X options.c                 2    
  600. X overlay.c                 3    
  601. X prntscan.c                4    
  602. X readme.now                6    
  603. X refresh.c                 2    
  604. X scrreg.c                  1    
  605. X setmode.c                 2    
  606. X setterm.c                 2    
  607. X smaldata.inc              1    
  608. X stradd.c                  1    
  609. X strget.c                  3    
  610. X tabsize.c                 1    
  611. X termmisc.c                1    
  612. X unctrl.c                  1    
  613. X update.c                  4    
  614. X winclear.c                1    
  615. X windel.c                  1    
  616. X winerase.c                1    
  617. X winmove.c                 1    
  618. X winscrol.c                1    
  619. X wintouch.c                1    
  620. END_OF_MANIFEST
  621. if test 1822 -ne `wc -c <MANIFEST`; then
  622.     echo \"MANIFEST\" unpacked with wrong size!
  623. fi
  624. # end of overwriting check
  625. fi
  626. if test -f move.c -a "${1}" != "-c" ; then 
  627.   echo Will not over-write existing file \"move.c\"
  628. else
  629. echo Extracting - \"move.c\"
  630. sed "s/^X//" >move.c <<'END_OF_move.c'
  631. X/****************************************************************/
  632. X/* Wmove() routine of the PCcurses package            */
  633. X/*                                */
  634. X/****************************************************************/
  635. X/* This version of curses is based on ncurses, a curses version    */
  636. X/* originally written by Pavel Curtis at Cornell University.    */
  637. X/* I have made substantial changes to make it run on IBM PC's,    */
  638. X/* and therefore consider myself free to make it public domain.    */
  639. X/*                Bjorn Larsson (bl@infovox.se)    */
  640. X/****************************************************************/
  641. X/* 1.4:  Use of short wherever possible. Portability        */
  642. X/*     improvements:                    900114    */
  643. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  644. X/* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  645. X/* 1.0:     Release:                    870515    */
  646. X/****************************************************************/
  647. X
  648. X#include <curses.h>
  649. X#include <curspriv.h>
  650. X
  651. Xchar _curses_move_rcsid[] = "@(#)move.c       v.1.4  - 900114";
  652. X
  653. X/****************************************************************/
  654. X/* Wmove() moves the cursor in window 'win' to position (x,y).    */
  655. X/****************************************************************/
  656. X
  657. Xint    wmove(win,y,x)
  658. X  WINDOW    *win;
  659. X  int         y;
  660. X  int         x;
  661. X  {
  662. X  if ((x < 0)||(x >= win->_maxx)||(y < win->_regtop)||(y > win->_regbottom))
  663. X    return(ERR);
  664. X  win->_curx = x;
  665. X  win->_cury = y;
  666. X  return(OK);
  667. X  } /* wmove */
  668. X
  669. X/****************************************************************/
  670. X/* Move() moves the cursor in stdscr to position (x,y).        */
  671. X/****************************************************************/
  672. X
  673. Xint move(y,x)
  674. X  int y;
  675. X  int x;
  676. X  {
  677. X  return(wmove(stdscr,y,x));
  678. X  } /* move */
  679. END_OF_move.c
  680. if test 1682 -ne `wc -c <move.c`; then
  681.     echo \"move.c\" unpacked with wrong size!
  682. fi
  683. # end of overwriting check
  684. fi
  685. if test -f mvcursor.c -a "${1}" != "-c" ; then 
  686.   echo Will not over-write existing file \"mvcursor.c\"
  687. else
  688. echo Extracting - \"mvcursor.c\"
  689. sed "s/^X//" >mvcursor.c <<'END_OF_mvcursor.c'
  690. X/****************************************************************/
  691. X/* Mvcur() routine of the PCcurses package            */
  692. X/*                                */
  693. X/****************************************************************/
  694. X/* This version of curses is based on ncurses, a curses version    */
  695. X/* originally written by Pavel Curtis at Cornell University.    */
  696. X/* I have made substantial changes to make it run on IBM PC's,    */
  697. X/* and therefore consider myself free to make it public domain.    */
  698. X/*                Bjorn Larsson (bl@infovox.se)    */
  699. X/****************************************************************/
  700. X/* 1.4:  Use of short wherever possible. Portability        */
  701. X/*     improvements:                    900114    */
  702. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  703. X/* 1.2:     Changed call sequqnce to cursesio.[c,asm], Thanks    */
  704. X/*     to S. Creps. Rcsid[] string for maintenance:    881002    */
  705. X/* 1.0:     Release:                    870515    */
  706. X/****************************************************************/
  707. X
  708. X#include <curses.h>
  709. X#include <curspriv.h>
  710. X
  711. Xchar _curses_mvcursor_rcsid[] = "@(#)mvcursor.c   v.1.4  - 900114";
  712. X
  713. X/****************************************************************/
  714. X/* Mvcur(oldy,oldx,newy,newx) the display cursor to <newy,newx>    */
  715. X/* [ NOTE: Compiler may warn that oldx and oldy are not used ]    *.
  716. X/****************************************************************/
  717. X
  718. Xint    mvcur(oldy,oldx,newy,newx)
  719. X  int oldy;
  720. X  int oldx;
  721. X  int newy;
  722. X  int newx;
  723. X  {
  724. X  if ((newy >= LINES) || (newx >= COLS) || (newy < 0) || (newx < 0))
  725. X    return(ERR);
  726. X  _cursescursor(newy,newx);
  727. X  _cursvar.cursrow = newy;
  728. X  _cursvar.curscol = newx;
  729. X  return(OK);
  730. X  } /* mvcur */
  731. END_OF_mvcursor.c
  732. if test 1593 -ne `wc -c <mvcursor.c`; then
  733.     echo \"mvcursor.c\" unpacked with wrong size!
  734. fi
  735. # end of overwriting check
  736. fi
  737. if test -f nearcall.inc -a "${1}" != "-c" ; then 
  738.   echo Will not over-write existing file \"nearcall.inc\"
  739. else
  740. echo Extracting - \"nearcall.inc\"
  741. sed "s/^X//" >nearcall.inc <<'END_OF_nearcall.inc'
  742. X    far_call EQU    0
  743. END_OF_nearcall.inc
  744. if test 16 -ne `wc -c <nearcall.inc`; then
  745.     echo \"nearcall.inc\" unpacked with wrong size!
  746. fi
  747. # end of overwriting check
  748. fi
  749. if test -f scrreg.c -a "${1}" != "-c" ; then 
  750.   echo Will not over-write existing file \"scrreg.c\"
  751. else
  752. echo Extracting - \"scrreg.c\"
  753. sed "s/^X//" >scrreg.c <<'END_OF_scrreg.c'
  754. X/****************************************************************/
  755. X/* Wsetscrreg() routine of the PCcurses package            */
  756. X/*                                */
  757. X/****************************************************************/
  758. X/* This version of curses is based on ncurses, a curses version    */
  759. X/* originally written by Pavel Curtis at Cornell University.    */
  760. X/* I have made substantial changes to make it run on IBM PC's,    */
  761. X/* and therefore consider myself free to make it public domain.    */
  762. X/*                Bjorn Larsson (bl@infovox.se)    */
  763. X/****************************************************************/
  764. X/* 1.4:  Use of short wherever possible. Portability        */
  765. X/*     improvements:                    900114    */
  766. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  767. X/* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  768. X/* 1.0:     Release:                    870515    */
  769. X/****************************************************************/
  770. X
  771. X#include <curses.h>
  772. X#include <curspriv.h>
  773. X
  774. Xchar _curses_scrreg_rcsid[] = "@(#)scrreg.c     v.1.4  - 900114";
  775. X
  776. X/****************************************************************/
  777. X/* Wsetscrreg() set the scrolling region of window 'win' to in-    */
  778. X/* clude all lines between 'top' and 'bottom'.            */
  779. X/****************************************************************/
  780. X
  781. Xint wsetscrreg(win, top, bottom)
  782. X  WINDOW    *win;
  783. X  int         top;
  784. X  int         bottom;
  785. X  {
  786. X  if (  (0 <= top)
  787. X    &&
  788. X    (top <= win->_cury)
  789. X    &&
  790. X    (win->_cury <= bottom)
  791. X    &&
  792. X    (bottom < win->_maxy)
  793. X     )
  794. X    {
  795. X    win->_regtop = top;
  796. X    win->_regbottom = bottom;
  797. X    return(OK);
  798. X    } /* if */
  799. X  else
  800. X    return(ERR);
  801. X  } /* wsetscrreg */
  802. X
  803. X/****************************************************************/
  804. X/* Setscrreg() set the scrolling region of stdscr to include    */
  805. X/* all lines between 'top' and 'bottom'.            */
  806. X/****************************************************************/
  807. X
  808. Xint setscrreg(top, bottom)
  809. X  int top;
  810. X  int bottom;
  811. X  {
  812. X  return(wsetscrreg(stdscr,top,bottom));
  813. X  } /* setscrreg */
  814. END_OF_scrreg.c
  815. if test 1932 -ne `wc -c <scrreg.c`; then
  816.     echo \"scrreg.c\" unpacked with wrong size!
  817. fi
  818. # end of overwriting check
  819. fi
  820. if test -f smaldata.inc -a "${1}" != "-c" ; then 
  821.   echo Will not over-write existing file \"smaldata.inc\"
  822. else
  823. echo Extracting - \"smaldata.inc\"
  824. sed "s/^X//" >smaldata.inc <<'END_OF_smaldata.inc'
  825. X    huge_data EQU    0
  826. END_OF_smaldata.inc
  827. if test 17 -ne `wc -c <smaldata.inc`; then
  828.     echo \"smaldata.inc\" unpacked with wrong size!
  829. fi
  830. # end of overwriting check
  831. fi
  832. if test -f stradd.c -a "${1}" != "-c" ; then 
  833.   echo Will not over-write existing file \"stradd.c\"
  834. else
  835. echo Extracting - \"stradd.c\"
  836. sed "s/^X//" >stradd.c <<'END_OF_stradd.c'
  837. X/****************************************************************/
  838. X/* Addstr() routines of the PCcurses package            */
  839. X/*                                */
  840. X/****************************************************************/
  841. X/* This version of curses is based on ncurses, a curses version    */
  842. X/* originally written by Pavel Curtis at Cornell University.    */
  843. X/* I have made substantial changes to make it run on IBM PC's,    */
  844. X/* and therefore consider myself free to make it public domain.    */
  845. X/*                Bjorn Larsson (bl@infovox.se)    */
  846. X/****************************************************************/
  847. X/* 1.4:  Use of short wherever possible. Portability        */
  848. X/*     improvements:                    900114    */
  849. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  850. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  851. X/* 1.0:     Release:                    870515    */
  852. X/****************************************************************/
  853. X
  854. X#include <curses.h>
  855. X#include <curspriv.h>
  856. X
  857. Xchar _curses_stradd_rcsid[] = "@(#)stradd.c     v.1.4  - 900114";
  858. X
  859. X/****************************************************************/
  860. X/* Waddstr() inserts string 'str' at the current cursor posi-    */
  861. X/* tion in window 'win', and takes any actions as dictated by    */
  862. X/* the characters.                        */
  863. X/****************************************************************/
  864. X
  865. Xint    waddstr(win, str)
  866. X  WINDOW    *win; 
  867. X  char        *str;
  868. X  {
  869. X  while (*str)
  870. X    {
  871. X    if (waddch(win, *str++) == ERR)
  872. X      return(ERR);
  873. X    }
  874. X  return(OK);
  875. X  } /* waddstr */
  876. X
  877. X/****************************************************************/
  878. X/* Addstr() inserts string 'str' at the current cursor posi-    */
  879. X/* tion in stdscr, and takes any actions as dictated by the    */
  880. X/* characters.                            */
  881. X/****************************************************************/
  882. X
  883. Xint addstr(str)
  884. X  char     *str;
  885. X  {
  886. X  return (waddstr(stdscr,str));
  887. X  } /* addstr */
  888. X
  889. X/****************************************************************/
  890. X/* Mvaddstr() move to a new position in stdscr, then inserts    */
  891. X/* string 'str' at the new position, taking any actions as dic-    */
  892. X/* tated by the characters.                    */
  893. X/****************************************************************/
  894. X
  895. Xint mvaddstr(y,x,str)
  896. X  int     y;
  897. X  int     x;
  898. X  char    *str;
  899. X  {
  900. X  if (wmove(stdscr,y,x) == ERR)
  901. X    return (ERR);
  902. X  return (waddstr(stdscr,str));
  903. X  } /* mvaddstr */
  904. X
  905. X/****************************************************************/
  906. X/* Mvwaddstr() move to a new position in window 'win', then    */
  907. X/* inserts string 'str' at the new position, taking any actions    */
  908. X/* as dictated by the characters.                */
  909. X/****************************************************************/
  910. X
  911. Xint mvwaddstr(win,y,x,str)
  912. X  WINDOW *win;
  913. X  int      y;
  914. X  int      x;
  915. X  char   *str;
  916. X  {
  917. X  if (wmove(win,y,x) == ERR)
  918. X    return (ERR);
  919. X  return (waddstr(win,str));
  920. X  } /* mvwaddstr */
  921. END_OF_stradd.c
  922. if test 2754 -ne `wc -c <stradd.c`; then
  923.     echo \"stradd.c\" unpacked with wrong size!
  924. fi
  925. # end of overwriting check
  926. fi
  927. if test -f tabsize.c -a "${1}" != "-c" ; then 
  928.   echo Will not over-write existing file \"tabsize.c\"
  929. else
  930. echo Extracting - \"tabsize.c\"
  931. sed "s/^X//" >tabsize.c <<'END_OF_tabsize.c'
  932. X/****************************************************************/
  933. X/* Tabsize() routines of the PCcurses package            */
  934. X/*                                */
  935. X/****************************************************************/
  936. X/* This version of curses is based on ncurses, a curses version    */
  937. X/* originally written by Pavel Curtis at Cornell University.    */
  938. X/* I have made substantial changes to make it run on IBM PC's,    */
  939. X/* and therefore consider myself free to make it public domain.    */
  940. X/*                Bjorn Larsson (bl@infovox.se)    */
  941. X/****************************************************************/
  942. X/* 1.4:  Use of short wherever possible. Portability        */
  943. X/*     improvements:                    900114    */
  944. X/* 1.3:  MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  945. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  946. X/* 1.0:     Release:                    870515    */
  947. X/****************************************************************/
  948. X
  949. X#include <curses.h>
  950. X#include <curspriv.h>
  951. X
  952. Xchar _curses_tabsize_rcsid[] = "@(#)tabsize.c    v.1.4  - 900114";
  953. X
  954. X/****************************************************************/
  955. X/* Wtabsize(win,ts) sets the tabsize of window 'win' to 'ts',    */
  956. X/* and returns the original value.                */
  957. X/****************************************************************/
  958. X
  959. Xint    wtabsize(win,ts)
  960. X  WINDOW    *win;
  961. X  int         ts;
  962. X  {
  963. X  short         origval;
  964. X
  965. X  origval = win->_tabsize;
  966. X  win->_tabsize = ts;
  967. X  return(origval);
  968. X  } /* wtabsize*/
  969. X
  970. X/****************************************************************/
  971. X/* Tabsize(ts) sets the tabsize of stdscr to 'ts', and returns    */
  972. X/* the original value.                        */
  973. X/****************************************************************/
  974. X
  975. Xint    tabsize(ts)
  976. X  int         ts;
  977. X  {
  978. X  short        origval;
  979. X
  980. X  origval = stdscr->_tabsize;
  981. X  stdscr->_tabsize = ts;
  982. X  return(origval);
  983. X  } /* tabsize */
  984. END_OF_tabsize.c
  985. if test 1752 -ne `wc -c <tabsize.c`; then
  986.     echo \"tabsize.c\" unpacked with wrong size!
  987. fi
  988. # end of overwriting check
  989. fi
  990. if test -f termmisc.c -a "${1}" != "-c" ; then 
  991.   echo Will not over-write existing file \"termmisc.c\"
  992. else
  993. echo Extracting - \"termmisc.c\"
  994. sed "s/^X//" >termmisc.c <<'END_OF_termmisc.c'
  995. X/****************************************************************/
  996. X/* Miscellaneous Terminal routines of the PCcurses package    */
  997. X/*                                */
  998. X/****************************************************************/
  999. X/* This version of curses is based on ncurses, a curses version    */
  1000. X/* originally written by Pavel Curtis at Cornell University.    */
  1001. X/* I have made substantial changes to make it run on IBM PC's,    */
  1002. X/* and therefore consider myself free to make it public domain.    */
  1003. X/*                Bjorn Larsson (bl@infovox.se)    */
  1004. X/****************************************************************/
  1005. X/* 1.4:  Use of short wherever possible. Portability        */
  1006. X/*     improvements:                    900114    */
  1007. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1008. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  1009. X/* 1.0:     Release:                    870515    */
  1010. X/****************************************************************/
  1011. X
  1012. X#include <curses.h>
  1013. X#include <curspriv.h>
  1014. X
  1015. X/* static variables or saving terminal modes */
  1016. X
  1017. Xchar _curses_termmisc_rcsid[] = "@(#)termmisc.c   v.1.4  - 900114";
  1018. X
  1019. Xstatic bool savedacr;
  1020. Xstatic bool savedcbr;
  1021. Xstatic bool savedecho;
  1022. Xstatic bool savedraw;
  1023. X
  1024. X/****************************************************************/
  1025. X/* Fixterm(), resetterm(), saveoldterm, saveterm() gettmode(),    */
  1026. X/* setterm() and baudrate() function dummies for compatibility.    */
  1027. X/****************************************************************/
  1028. X
  1029. Xint fixterm()
  1030. X  {
  1031. X  return(OK);
  1032. X  } /* fixterm */
  1033. X
  1034. Xint resetterm()
  1035. X  {
  1036. X  return(OK);
  1037. X  }
  1038. X
  1039. Xint saveoldterm()
  1040. X  {
  1041. X  return(OK);
  1042. X  } /* saveoldterm */
  1043. X
  1044. Xint saveterm()
  1045. X  {
  1046. X  return(OK);
  1047. X  } /* saveterm */
  1048. X
  1049. Xint gettmode()
  1050. X  {
  1051. X  return(OK);
  1052. X  } /* gettmode */
  1053. X
  1054. Xint setterm()
  1055. X  {
  1056. X  return(OK);
  1057. X  } /* setterm */
  1058. X
  1059. Xint baudrate()
  1060. X  {
  1061. X  return(19200);
  1062. X  } /* baudrate */
  1063. X
  1064. X/****************************************************************/
  1065. X/* Erasechar(), killchar() returns std MSDOS erase chars.    */
  1066. X/****************************************************************/
  1067. X
  1068. Xint erasechar()
  1069. X  {
  1070. X  return(_DCCHAR);        /* character delete char */
  1071. X  } /* erasechar */
  1072. X
  1073. Xint killchar()
  1074. X  {
  1075. X  return(_DLCHAR);        /* line delete char */
  1076. X  } /* killchar */
  1077. X
  1078. X/****************************************************************/
  1079. X/* Savetty() and resetty() saves and restores the terminal I/O    */
  1080. X/* settings.                            */
  1081. X/****************************************************************/
  1082. X
  1083. Xint savetty()
  1084. X  {
  1085. X  savedacr  = _cursvar.autocr;
  1086. X  savedcbr  = _cursvar.cbreak;
  1087. X  savedecho = _cursvar.echo;
  1088. X  savedraw  = _cursvar.raw;
  1089. X  return(OK);
  1090. X  } /* savetty */
  1091. X
  1092. Xint resetty()
  1093. X  {
  1094. X  _cursvar.autocr = savedacr;
  1095. X  _cursvar.cbreak = savedcbr;
  1096. X  _cursvar.echo   = savedecho;
  1097. X  _cursvar.raw    = savedraw;
  1098. X  return(OK);
  1099. X  } /* resetty */
  1100. X
  1101. X/****************************************************************/
  1102. X/* Setupterm() sets up the terminal. On a PC, it is always suc-    */
  1103. X/* cessful, and returns 1.                    */
  1104. X/****************************************************************/
  1105. X
  1106. Xint setupterm()
  1107. X  {
  1108. X  return(1);
  1109. X  } /* setupterm */
  1110. END_OF_termmisc.c
  1111. if test 2979 -ne `wc -c <termmisc.c`; then
  1112.     echo \"termmisc.c\" unpacked with wrong size!
  1113. fi
  1114. # end of overwriting check
  1115. fi
  1116. if test -f unctrl.c -a "${1}" != "-c" ; then 
  1117.   echo Will not over-write existing file \"unctrl.c\"
  1118. else
  1119. echo Extracting - \"unctrl.c\"
  1120. sed "s/^X//" >unctrl.c <<'END_OF_unctrl.c'
  1121. X/****************************************************************/
  1122. X/* Unctrl() routines of the PCcurses package            */
  1123. X/*                                */
  1124. X/****************************************************************/
  1125. X/* This version of curses is based on ncurses, a curses version    */
  1126. X/* originally written by Pavel Curtis at Cornell University.    */
  1127. X/* I have made substantial changes to make it run on IBM PC's,    */
  1128. X/* and therefore consider myself free to make it public domain.    */
  1129. X/*                Bjorn Larsson (bl@infovox.se)    */
  1130. X/****************************************************************/
  1131. X/*             IMPLEMENTATION NOTE            */
  1132. X/* The conversion from a control character to a two-character    */
  1133. X/* sequence is done by the unctrl() function. In the BSD ver-    */
  1134. X/* sion of curses it is done by a macro, which uses a publi-    */
  1135. X/* cally available translation table. Some ill-behaved appli-    */
  1136. X/* cation programs use the table directly, and since it does    */
  1137. X/* not exist in this curses version such application will link    */
  1138. X/* with an error message complainting about undefined symbols.    */
  1139. X/****************************************************************/
  1140. X/* 1.4:  Use of short wherever possible. Portability        */
  1141. X/*     improvements. Fix for character signed-ness        */
  1142. X/*     and 8-bit ASCII:                900114    */
  1143. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1144. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  1145. X/* 1.0:     Release:                    870515    */
  1146. X/****************************************************************/
  1147. X
  1148. X#include <curses.h>
  1149. X#include <curspriv.h>
  1150. X
  1151. Xstatic char    strbuf[3] = {0,0,0};
  1152. X
  1153. Xchar _curses_unctrl_rcsid[] = "@(#)unctrl.c     v.1.4  - 900114";
  1154. X
  1155. X/****************************************************************/
  1156. X/* Unctrl() returns a char pointer to a string corresponding to    */
  1157. X/* argument character 'c'.                    */
  1158. X/****************************************************************/
  1159. X
  1160. Xchar *unctrl(c)
  1161. X  char c;
  1162. X  {
  1163. X  short ic = c;
  1164. X  ic &= 0xff;
  1165. X  
  1166. X  if (((ic & 0xe0) != 0) && (ic != 0x7f))    /* normal characters */
  1167. X    {
  1168. X    strbuf[0] = (char) ic;
  1169. X    strbuf[1] = '\0';
  1170. X    return(strbuf);
  1171. X    } /* if */
  1172. X  strbuf[0] = '^';                /* '^' prefix */
  1173. X  if (c == 0x7f)                /* DEL */
  1174. X    strbuf[1] = '?';
  1175. X  else                        /* other control */
  1176. X    strbuf[1] = ((char) ic) + '@';
  1177. X  return(strbuf);
  1178. X  } /* unctrl */
  1179. END_OF_unctrl.c
  1180. if test 2266 -ne `wc -c <unctrl.c`; then
  1181.     echo \"unctrl.c\" unpacked with wrong size!
  1182. fi
  1183. # end of overwriting check
  1184. fi
  1185. if test -f winclear.c -a "${1}" != "-c" ; then 
  1186.   echo Will not over-write existing file \"winclear.c\"
  1187. else
  1188. echo Extracting - \"winclear.c\"
  1189. sed "s/^X//" >winclear.c <<'END_OF_winclear.c'
  1190. X/****************************************************************/
  1191. X/* Clear() routines of the PCcurses package            */
  1192. X/*                                */
  1193. X/****************************************************************/
  1194. X/* This version of curses is based on ncurses, a curses version    */
  1195. X/* originally written by Pavel Curtis at Cornell University.    */
  1196. X/* I have made substantial changes to make it run on IBM PC's,    */
  1197. X/* and therefore consider myself free to make it public domain.    */
  1198. X/*                Bjorn Larsson (bl@infovox.se)    */
  1199. X/****************************************************************/
  1200. X/* 1.4:  Use of short wherever possible. Portability        */
  1201. X/*     improvements:                    900114    */
  1202. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1203. X/* 1.2:     Rcsid[] string for maintenance:        881002    */
  1204. X/* 1.0:     Release:                    870515    */
  1205. X/****************************************************************/
  1206. X
  1207. X#include <curses.h>
  1208. X#include <curspriv.h>
  1209. X
  1210. Xchar _curses_winclear_rcsid[] = "@(#)winclear.c   v.1.4  - 900114";
  1211. X
  1212. X/****************************************************************/
  1213. X/* Wclear() fills all lines of window 'win' with blanks, and    */
  1214. X/* marks the window to be cleared at next refresh operation.    */
  1215. X/****************************************************************/
  1216. X
  1217. Xvoid    wclear(win)
  1218. X  WINDOW    *win;
  1219. X  {
  1220. X  werase(win);
  1221. X  win->_clear = TRUE;
  1222. X  } /* wclear */
  1223. X
  1224. X/****************************************************************/
  1225. X/* Clear() fills all lines of stdscr with blanks, and marks    */
  1226. X/* marks sdtscr to be cleared at next refresh operation.    */
  1227. X/****************************************************************/
  1228. X
  1229. Xvoid clear()
  1230. X  {
  1231. X  werase(stdscr);
  1232. X  stdscr->_clear = TRUE;
  1233. X  } /* clear */
  1234. END_OF_winclear.c
  1235. if test 1664 -ne `wc -c <winclear.c`; then
  1236.     echo \"winclear.c\" unpacked with wrong size!
  1237. fi
  1238. # end of overwriting check
  1239. fi
  1240. if test -f windel.c -a "${1}" != "-c" ; then 
  1241.   echo Will not over-write existing file \"windel.c\"
  1242. else
  1243. echo Extracting - \"windel.c\"
  1244. sed "s/^X//" >windel.c <<'END_OF_windel.c'
  1245. X/****************************************************************/
  1246. X/* Delwin() routine of the PCcurses package.            */
  1247. X/*                                */
  1248. X/****************************************************************/
  1249. X/* This version of curses is based on ncurses, a curses version    */
  1250. X/* originally written by Pavel Curtis at Cornell University.    */
  1251. X/* I have made substantial changes to make it run on IBM PC's,    */
  1252. X/* and therefore consider myself free to make it public domain.    */
  1253. X/*                Bjorn Larsson (bl@infovox.se)    */
  1254. X/****************************************************************/
  1255. X/* 1.4:  Use of short wherever possible. Portability        */
  1256. X/*     improvements:                    900114    */
  1257. X/* 1.3:  MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1258. X/* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1259. X/* 1.0:     Release:                    870515    */
  1260. X/****************************************************************/
  1261. X
  1262. X#include <curses.h>
  1263. X#include <curspriv.h>
  1264. X
  1265. Xchar _curses_windel_rcsid[] = "@(#)windel.c     v.1.4  - 900114";
  1266. X
  1267. X/****************************************************************/
  1268. X/* Delwin() deallocates all data allocated by 'win'. If 'win'    */
  1269. X/* is a subwindow, it uses the original window's lines for sto-    */
  1270. X/* rage, and thus the line arrays are not deallocated.        */
  1271. X/****************************************************************/
  1272. X
  1273. Xvoid delwin(win)
  1274. X  WINDOW    *win;
  1275. X  {
  1276. X  short         i;
  1277. X
  1278. X  if (! (win->_flags & _SUBWIN))    /* subwindow uses 'parent's' lines */
  1279. X    {
  1280. X    for (i = 0; i < win->_maxy && win->_line[i]; i++)
  1281. X      free(win->_line[i]);
  1282. X    }
  1283. X  free(win->_minchng);
  1284. X  free(win->_maxchng);
  1285. X  free(win->_line);
  1286. X  free(win);
  1287. X  } /* delwin */
  1288. END_OF_windel.c
  1289. if test 1625 -ne `wc -c <windel.c`; then
  1290.     echo \"windel.c\" unpacked with wrong size!
  1291. fi
  1292. # end of overwriting check
  1293. fi
  1294. if test -f winerase.c -a "${1}" != "-c" ; then 
  1295.   echo Will not over-write existing file \"winerase.c\"
  1296. else
  1297. echo Extracting - \"winerase.c\"
  1298. sed "s/^X//" >winerase.c <<'END_OF_winerase.c'
  1299. X/****************************************************************/
  1300. X/*                                */
  1301. X/* Erase() routines of the PCcurses package            */
  1302. X/*                                */
  1303. X/****************************************************************/
  1304. X/* This version of curses is based on ncurses, a curses version    */
  1305. X/* originally written by Pavel Curtis at Cornell University.    */
  1306. X/* I have made substantial changes to make it run on IBM PC's,    */
  1307. X/* and therefore consider myself free to make it public domain.    */
  1308. X/*                Bjorn Larsson (bl@infovox.se)    */
  1309. X/****************************************************************/
  1310. X/* 1.4:  Use of short wherever possible. Portability        */
  1311. X/*     improvements:                    900114    */
  1312. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1313. X/* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1314. X/* 1.0:     Release:                    870515    */
  1315. X/****************************************************************/
  1316. X
  1317. X#include <curses.h>
  1318. X#include <curspriv.h>
  1319. X
  1320. Xchar _curses_winerase_rcsid[] = "@(#)winerase.c   v.1.4  - 900114";
  1321. X
  1322. X/****************************************************************/
  1323. X/* Werase() fills all lines of window 'win' with blanks and po-    */
  1324. X/* sitions the cursor at home in the scroll region.        */
  1325. X/****************************************************************/
  1326. X
  1327. Xvoid    werase(win)
  1328. X  WINDOW    *win;
  1329. X  {
  1330. X  short        *end;
  1331. X  short        *start;
  1332. X  short         y;
  1333. X  static short     blank;
  1334. X  
  1335. X  blank = ' ' | (win->_attrs & ATR_MSK);
  1336. X
  1337. X  for (y = win->_regtop; y <= win->_regbottom; y++)    /* clear all lines */
  1338. X    {
  1339. X    start = win->_line[y];
  1340. X    end = &start[win->_maxx - 1];
  1341. X    while (start <= end)                /* clear all line */
  1342. X      *start++ = blank;
  1343. X    win->_minchng[y] = 0;
  1344. X    win->_maxchng[y] = win->_maxx - 1;
  1345. X    }
  1346. X  win->_cury = win->_regtop;                /* cursor home */
  1347. X  win->_curx = 0;
  1348. X  } /* werase */
  1349. X
  1350. X/****************************************************************/
  1351. X/* Erase() fills all lines of stdscr with blanks and positions    */
  1352. X/* the cursor at home in the scroll region.            */
  1353. X/****************************************************************/
  1354. X
  1355. Xvoid erase()
  1356. X  {
  1357. X  werase(stdscr);
  1358. X  } /* erase */
  1359. END_OF_winerase.c
  1360. if test 2082 -ne `wc -c <winerase.c`; then
  1361.     echo \"winerase.c\" unpacked with wrong size!
  1362. fi
  1363. # end of overwriting check
  1364. fi
  1365. if test -f winmove.c -a "${1}" != "-c" ; then 
  1366.   echo Will not over-write existing file \"winmove.c\"
  1367. else
  1368. echo Extracting - \"winmove.c\"
  1369. sed "s/^X//" >winmove.c <<'END_OF_winmove.c'
  1370. X/****************************************************************/
  1371. X/* Mvwin() routine of the PCcurses package            */
  1372. X/*                                */
  1373. X/****************************************************************/
  1374. X/* This version of curses is based on ncurses, a curses version    */
  1375. X/* originally written by Pavel Curtis at Cornell University.    */
  1376. X/* I have made substantial changes to make it run on IBM PC's,    */
  1377. X/* and therefore consider myself free to make it public domain.    */
  1378. X/*                Bjorn Larsson (bl@infovox.se)    */
  1379. X/****************************************************************/
  1380. X/* 1.4:  Use of short wherever possible. Portability        */
  1381. X/*     improvements:                    900114    */
  1382. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1383. X/* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1384. X/* 1.0:     Release:                    870515    */
  1385. X/****************************************************************/
  1386. X
  1387. X#include <curses.h>
  1388. X#include <curspriv.h>
  1389. X
  1390. Xchar _curses_winmove_rcsid[] = "@(#)winmove.c    v.1.4  - 900114";
  1391. X
  1392. X/****************************************************************/
  1393. X/* Mvwin() moves window 'win' to position (begx, begy) on the    */
  1394. X/* screen.                            */
  1395. X/****************************************************************/
  1396. X
  1397. Xint    mvwin(win, begy, begx)
  1398. X  WINDOW    *win;
  1399. X  int         begy, begx;
  1400. X  {
  1401. X  if ((begy + win->_maxy) >= (LINES-1) || (begx + win->_maxx) > (COLS-1))
  1402. X    return(ERR);
  1403. X  win->_begy = begy;
  1404. X  win->_begx = begx;
  1405. X  touchwin(win);
  1406. X  return(OK);
  1407. X  } /* mvwin */
  1408. END_OF_winmove.c
  1409. if test 1454 -ne `wc -c <winmove.c`; then
  1410.     echo \"winmove.c\" unpacked with wrong size!
  1411. fi
  1412. # end of overwriting check
  1413. fi
  1414. if test -f winscrol.c -a "${1}" != "-c" ; then 
  1415.   echo Will not over-write existing file \"winscrol.c\"
  1416. else
  1417. echo Extracting - \"winscrol.c\"
  1418. sed "s/^X//" >winscrol.c <<'END_OF_winscrol.c'
  1419. X/****************************************************************/
  1420. X/* Scroll() routine of the PCcurses package            */
  1421. X/*                                */
  1422. X/****************************************************************/
  1423. X/* This version of curses is based on ncurses, a curses version    */
  1424. X/* originally written by Pavel Curtis at Cornell University.    */
  1425. X/* I have made substantial changes to make it run on IBM PC's,    */
  1426. X/* and therefore consider myself free to make it public domain.    */
  1427. X/*                Bjorn Larsson (bl@infovox.se)    */
  1428. X/****************************************************************/
  1429. X/* 1.4:  Use of short wherever possible. Portability        */
  1430. X/*     improvements:                    900114    */
  1431. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1432. X/* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1433. X/* 1.0:     Release:                    870515    */
  1434. X/****************************************************************/
  1435. X
  1436. X#include <curses.h>
  1437. X#include <curspriv.h>
  1438. X
  1439. Xchar _curses_winscrol_rcsid[] = "@(#)winscrol.c   v.1.4  - 900114";
  1440. X
  1441. X/****************************************************************/
  1442. X/* Scroll() scrolls the scrolling region of 'win', but only if    */
  1443. X/* scrolling is allowed and if the cursor is inside the scrol-    */
  1444. X/* ling region.                            */
  1445. X/****************************************************************/
  1446. X
  1447. Xvoid    scroll(win)
  1448. X  WINDOW    *win;
  1449. X  {
  1450. X  short         i;
  1451. X  short        *ptr;
  1452. X  short        *temp;
  1453. X  static short     blank;
  1454. X
  1455. X  blank = ' ' | (win->_attrs & ATR_MSK);
  1456. X  if  (       (!win->_scroll)            /* check if window scrolls */
  1457. X    || (win->_cury < win->_regtop)        /* and cursor in region */
  1458. X        || (win->_cury > win->_regbottom)
  1459. X      )
  1460. X    return;
  1461. X
  1462. X  temp = win->_line[win->_regtop];
  1463. X  for (i = win->_regtop; i < win->_regbottom; i++)
  1464. X    {
  1465. X    win->_line[i] = win->_line[i+1];        /* re-arrange line pointers */
  1466. X    win->_minchng[i] = 0;
  1467. X    win->_maxchng[i] = win->_maxx - 1;
  1468. X    }
  1469. X  for (ptr = temp; ptr - temp < win->_maxx; ptr++)
  1470. X    *ptr = blank;                /* make a blank line */
  1471. X  win->_line[win->_regbottom] = temp;
  1472. X  if (win->_cury > win->_regtop)        /* if not on top line */
  1473. X    win->_cury--;                /* cursor scrolls too */
  1474. X  win->_minchng[win->_regbottom] = 0;
  1475. X  win->_maxchng[win->_regbottom] = win->_maxx - 1;
  1476. X  } /* scroll */
  1477. END_OF_winscrol.c
  1478. if test 2186 -ne `wc -c <winscrol.c`; then
  1479.     echo \"winscrol.c\" unpacked with wrong size!
  1480. fi
  1481. # end of overwriting check
  1482. fi
  1483. if test -f wintouch.c -a "${1}" != "-c" ; then 
  1484.   echo Will not over-write existing file \"wintouch.c\"
  1485. else
  1486. echo Extracting - \"wintouch.c\"
  1487. sed "s/^X//" >wintouch.c <<'END_OF_wintouch.c'
  1488. X/****************************************************************/
  1489. X/* Touchwin() routine of the PCcurses package            */
  1490. X/*                                */
  1491. X/****************************************************************/
  1492. X/* This version of curses is based on ncurses, a curses version    */
  1493. X/* originally written by Pavel Curtis at Cornell University.    */
  1494. X/* I have made substantial changes to make it run on IBM PC's,    */
  1495. X/* and therefore consider myself free to make it public domain.    */
  1496. X/*                Bjorn Larsson (bl@infovox.se)    */
  1497. X/****************************************************************/
  1498. X/* 1.4:  Use of short wherever possible. Portability        */
  1499. X/*     improvements:                    900114    */
  1500. X/* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  1501. X/* 1.2:     Max limits off by 1. Fixed thanks to S. Creps:    881002    */
  1502. X/* 1.0:     Release:                    870515    */
  1503. X/****************************************************************/
  1504. X
  1505. X#include <curses.h>
  1506. X#include <curspriv.h>
  1507. X
  1508. Xchar _curses_wintouch_rcsid[] = "@(#)wintouch.c   v.1.4  - 900114";
  1509. X
  1510. X/****************************************************************/
  1511. X/* Touchwin() marks all lines of window 'win' as changed, from    */
  1512. X/* the first to the last character on the line.            */
  1513. X/****************************************************************/
  1514. X
  1515. Xvoid touchwin(win)
  1516. X  WINDOW    *win;
  1517. X  {
  1518. X  short    y;
  1519. X  short maxy;
  1520. X  short maxx;
  1521. X
  1522. X  maxy = win->_maxy - 1;
  1523. X  maxx = win->_maxx - 1;
  1524. X
  1525. X  for (y = 0; y <= maxy; y++)
  1526. X    {
  1527. X    win->_minchng[y] = 0;
  1528. X    win->_maxchng[y] = maxx;
  1529. X    } /* for */
  1530. X  } /* touchwin */
  1531. END_OF_wintouch.c
  1532. if test 1501 -ne `wc -c <wintouch.c`; then
  1533.     echo \"wintouch.c\" unpacked with wrong size!
  1534. fi
  1535. # end of overwriting check
  1536. fi
  1537. echo End of archive 1 \(of 7\).
  1538. cp /dev/null archdone.1
  1539. MISSING=""
  1540. for I in 1 2 3 4 5 6 7 ; do
  1541.     if test ! -f archdone.${I} ; then
  1542.     MISSING="${MISSING} ${I}"
  1543.     fi
  1544. done
  1545. if test "${MISSING}" = "" ; then
  1546.     echo You have unpacked all 7 archives.
  1547.     rm -f archdone.[1-9]
  1548. else
  1549.     echo You still need to unpack the following archives:
  1550.     echo "        " ${MISSING}
  1551. fi
  1552. ##  End of shell archive.
  1553. exit 0
  1554.  
  1555.